Email Template Rules
The template contains all of the HTML elements and style needed for the notification. Follow the naming rules and file structure below to ensure that the template is accepted:
- For an HTML template, name your file as template.html.
- With regard to images:
- You can upload three kinds of images - a logo image, an iOS app icon, and an Android app icon.
- Image file types are restricted to JPG, GIF, and PNG.
- Image file names are restricted to logo_image.[extension], ios_app_link_image.[extension], and android_app_link_image.[extension].
- When using the services for the user password reset instructions and the user confirmation on sign-up (or re-confirmation of the original email request), create a separate text file for your email's subject line. You no longer have to add the subject line to web or mobile app as an API parameter. See the subject line text file in the example of the compressed file below.
- Compress the HTML, text, and image files into a zipped file. Refer to the example above.
IMPORTANT! |
Files sizes are restricted to 1MB; files larger than this size cannot be uploaded to the dashboard. |
- Use the Upload Template icon in the Ayla Customer Dashboard to upload your file. After clicking this icon, select your file and then click OPEN.
- Make any updates to the email template in the Ayla Customer Dashboard; click here for steps to edit/view email templates.
NOTE |
The procedure to upload email templates is the same in the Development and Field Service environments for the Ayla Customer Dashboard. Refer to Access the Ayla Customer Dashboard for more information on these environments. |
- No scripts are allowed as part of the HTML.
- Use tags to specify how and where situational data is inserted when an email is composed on the Ayla Cloud. The following tags are supported for substitution:
- [[logo_image]] - The OEM’s logo
- [[ios__app_link_image]] - The image to be displayed as part of the iPad/iPhone app link
- [[android_app_link_image]] - The image to be displayed as part of the Android app link
- [[property_name]] - The name of the property
- [[property_value]] - The value of the property that triggered the alert
- [[property_update_time]] - The time at which the property reached the value that triggered the alert
- [[device_product_name]] - The name of the device
- [[device_dsn]] - The Device Serial Number (DSN) of the device
- [[user_name]] - The username that can be used in the greeting, as specified during trigger app creation.
- [[user_message]] - The user message defined during the creation of a trigger app.
- [[trigger_app_email_body]] - The placeholder for the body part of a trigger email alert.
- [[user_confirmation_token]] - The confirmation token generated by the Ayla Cloud to confirm the user.
- [[user_password_reset_token]] - The password reset token generated by the Ayla Cloud
- These tags (listed above) can be categorized based on the origin of their substitutions. The categories are as follows:
Tags for the data that comes from the uploaded template:
- [[logo_image]]
- [[ios_app_link_image]]
- [[android_app_link_image]]
Tags for the data that comes from the Ayla Cloud:
Trigger App-Related Tags
- [[property_name]]
- [[property_value]]
- [[property_update_time]]
- [[device_product_name]]
- [[device_dsn]]
- [[user_message]]
For SMS messages, the character length is set by the SMSSimple Mail Service provider. The recommended maximum length is 120 characters.
For Push notifications, the notification object name has a maximum length of 20. The maximum size of the message (with the object name) is 159.
- [[user_name]]
- [[trigger_app_email_body]] - The high-level tag to indicate that the html+tags come from the trigger_app at actual time the trigger fires.
User sign-up (re) confirmation-related tags:
- [[user_confirmation_token]]
- [[user_name]]
User password reset-related tags
- [[user_password_reset_token]]
- [[user_name]]
- The double-bracketing format [[xxxx]] is important for proper substitutions.
- Use the samples for various templates when needed, which can be downloaded from the Message Templates page on the Dashboard; click here for details.
- A template for a trigger-alert email may display similar details, as follows:
file://localhost/Users/<registered user name>/<download directory>/ayla_custom_email_samples>/trigger_app/template.html
logo image
[[trigger_âpp_email_body]]
open your app here:
- iOS_app_link_image
- Android_app_link_image
Following is an example of an email after the substitutions were made in the Ayla Cloud:
NOTE |
This sample email (above) was constructed using the trigger_app_email_body. This was passed as a parameter to the trigger_app. See the code below. |
<tr>
<td valign="middle" class="td4">
<p class="p2"><br></p>
</td>
</tr>
<tr>
<td valign="middle" class="td4">
<h2 style="margin: 0.0px 0.0px 29.0px 0.0px; font: 36.0px Arial; color: #153643"><b>Hello [[username]]</b></h2>
</td>
</tr>
<tr>
<td valign="middle" class="td4">
<h2 style="margin: 0.0px 0.0px 29.0px 0.0px; font: 36.0px Arial; color: #153643"><b>[[property_name]]</b> is now <b>[[property_value]]</b> degrees on your [[device_product_name]].</h2>
</td>
</tr>
Please click here to let us know how we're doing. Thank you.